package com.ysh.mapper;

import com.ysh.domain.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface StudentMapper {
    // 查询全部
    @Select("select * from t_student")
    public abstract List<Student> selectAll();

    // 新增操作
    @Insert("insert into t_student values(#{id},#{name},#{age})")
    public abstract Integer insert(Student stu);

    // 修改操作
    @Update("update t_student set name=#{name},age=#{age} where id=#{id}")
    public abstract Integer update(Student stu);

    // 删除操作
    @Delete("delete from t_student where id=#{id}")
    public abstract Integer delete (Integer id);
}
